package org.springframework.web.servlet.mvc.support;

//Need to switch this in now!
public class DynamicHandlerMapping extends ControllerClassNameHandlerMapping{
    private String  path = "/*";
    private String theOneControllerName = "org.groovyflow.spring.web.RouterController";
    private String springSuffixWhyDoTheyDoThis = "#0";
    private String nameToMatch = theOneControllerName + springSuffixWhyDoTheyDoThis;

    @Override
    protected String[] generatePathMappings(Class beanClass) {
        return new String[] {path};
   }
    @Override
    protected boolean isEligibleForMapping(String beanName, Class beanClass) {
        return nameToMatch.equals(beanName);
    }

   /* @Override
    protected String generatePathMapping(Class beanClass) {
         return path;
    }*/


    public void setPath(String path) {
        this.path = path;
    }

    public void setTheOneControllerName(String theOneControllerName) {
        this.theOneControllerName = theOneControllerName;
    }

}